import api from '@/utils/axios';

export interface ApifoxModal {
  addTime?: Date;
  assetsEnglish?: string;
  assetsId?: number;
  modifyTime?: Date;
  assetsMsg?: string;
  assetsName?: string;
  assetsStatus?: number;
  operation?: number | string;
}
export interface ModifyApifoxModal {
  assetsIds?: number[];
  assetsStatus?: number;
}

export interface CatalogueData {
  code?: number;
  data?: { [key: string]: any };
  msg?: string;
}

enum Api {
  GETASSETTABLE = '/assets/queryAssetBle',
  MODIFYSTAtUS = '/assets/updateAssetsStatus',
  GETCATALOGUE = '/assets/selectAllAss',
  ADDASSET = '/assets/addAssets',
  GETSTANDDATA = '/standard/getAllInterface',
  CatalogueData = '/assets/selectAllAss',
  ADDCATALOGUE = '/assets/addAssetsDirectory',
  DELECATAloue = '/assets/deleteAssetsValue',
  SEARCHCATALOGUE = '/assets/selectByDirNameAndAssName',
  ACCOUNDFLASH = '/assets/selectAssets',
  UPDATEASSET = '/assets/updateAssetMsg',
  UPDATECATALOGUENAME = '/assets/updateAssetsDirectoryName',
}

export const accountInfoApi = (data?: any) => api({ url: Api.GETASSETTABLE, method: 'post', data });
export const BatchModify = (data: any) => api({ url: Api.MODIFYSTAtUS, method: 'post', data });
export const deleteAsset = (data: any) => api({ url: '/assets/deleteAsset/', method: 'delete', params: { assetsId: data } });
export const getCatalogue = (data?: any) => api({ url: Api.GETCATALOGUE, method: 'get', data });
export const AddAsset = (data: any) => api({ url: Api.ADDASSET, method: 'post', data });
export const querySingleapi = (data: any) => api({ url: 'assets/querySingle/', method: 'get', params: { assetsId: data } });
export const getStandDataApi = (data?: any) => api({ url: Api.GETSTANDDATA, method: 'get' });
// export const AddAsset = (data:any) => api({ url: Api.ADDASSET, method: 'post' ,data});
export const getCatalogueDataApi = (data?: any) => api({ url: Api.CatalogueData, method: 'get' });
export const addCatalogueDataApi = (data?: any) => api({ url: Api.ADDCATALOGUE, method: 'post', data });
export const deleteCatalogueDataApi = (data?: any) => api({ url: Api.DELECATAloue, method: 'delete', params: { directoryId: data } });
export const searchCatalogueDataApi = (data?: any) => api({ url: Api.SEARCHCATALOGUE, method: 'post', data });
export const AccoundIdCatalogueDataApi = (data?: any) => api({ url: Api.ACCOUNDFLASH, method: 'post', data });
export const UpdateAssetContentDataApi = (data?: any) => api({ url: Api.UPDATEASSET, method: 'post', data });
export const UpdateCatalogueName = (data?: any) => api({ url: Api.UPDATECATALOGUENAME, method: 'post', data });
